package org.jdemo.orm.mybatis.service;

import org.jdemo.orm.mybatis.dao.CompanyDAO;
import org.jdemo.orm.mybatis.entity.Company;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * CompanyService
 *
 * @author longlin(longlin@cyou-inc.com)
 * @date 202014/4/14
 * @since V1.0
 */
@Service
public class CompanyService {
    @Autowired
    private CompanyDAO companyDAO;

    public void create() {
        Company company = new Company();
        company.setName("abc");
        company.setAge(12);
        companyDAO.create(company);

        company = companyDAO.get(company.getId());
        System.out.println(company.getId());
    }
}
